import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';


void main()=>runApp(
    MaterialApp(
      home: Scaffold(
        body: MyApp(),
      ),
      theme: ThemeData(
        primarySwatch: Colors.yellow,
        textTheme: TextTheme(),
        buttonTheme: ButtonThemeData(buttonColor: Colors.yellow),
      ),
    )
);

class MyApp extends StatefulWidget {

  @override
  State<StatefulWidget> createState() {
    return _MyAppState();
  }

}

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.fromLTRB(0,MediaQuery.of(context).padding.top,0,0),
      child:Align(
        widthFactor: 2,
        heightFactor: 2,
        // alignment: Alignment.center,
        //(Alignment.x*childWidth/2+childWidth/2, Alignment.y*childHeight/2+childHeight/2)
        alignment: Alignment(2,0.0),
        //(FractionalOffse.x * childWidth, FractionalOffse.y * childHeight)
        // alignment: FractionalOffset(2,0.0),
        child: FlutterLogo(
          size: 60,
        ),
      ),
      //通过ConstrainedBox来确保Stack占满屏幕
      // ConstrainedBox(
      //   constraints: BoxConstraints.expand(),
      //   child: Stack(
      //     alignment:Alignment.center , //指定未定位或部分定位widget的对齐方式
      //     children: <Widget>[
      //       Container(
      //         child: Image.network(
      //           "https://img1.baidu.com/it/u=3435361414,3054623528&fm=253&fmt=auto&app=138&f=JPEG?w=224&h=322",
      //           width: 100.0,
      //           height: 100.0,
      //         ),
      //       ),
      //       Positioned(
      //         left: 18.0,
      //         child: Image.network(
      //           "https://img1.baidu.com/it/u=3435361414,3054623528&fm=253&fmt=auto&app=138&f=JPEG?w=224&h=322",
      //           width: 100.0,
      //           height: 100.0,
      //         ),
      //       ),
      //       Positioned(
      //         top: 18.0,
      //         child: Image.network(
      //           "https://img1.baidu.com/it/u=3435361414,3054623528&fm=253&fmt=auto&app=138&f=JPEG?w=224&h=322",
      //           width: 100.0,
      //           height: 100.0,
      //         ),
      //       )
      //     ],
      //   ),
      // ),
    );
  }

}







